﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Empires.RAL.Access;
using Empires.RAL.ORM;

namespace Empires.RAL.Pump
{
    public class AppContactDataPump : IAppContactAccess
    {
        public int PostContactMessage(string appellaction, string contact, string title, string message)
        {
            using (mysql_empiresEntities ctx = new mysql_empiresEntities())
            {
                ctx.tb_message.AddObject(
                    new tb_message()
                    {
                        c_b_isread = false,
                        c_dt_date = DateTime.Now,
                        c_nvc_concat = contact,
                        c_nvc_content = message,
                        c_nvc_title = title,
                        c_vc_author = appellaction
                    });
                return ctx.SaveChanges();
            }
        }
    }
}
